package com.wx.soft.contoller.sys;

import com.wx.sys.model.biz.SysRescView;
import com.wx.sys.service.SysRoleRescFeignApi;
import com.wx.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by king-pc on 2018/12/4.
 */
@Controller
@RequestMapping("/index")
public class IndexContoller {

    @Autowired
    private SysRoleRescFeignApi sysRoleRescFeignApi;

    /**
     * 登录首页
     * @param request
     * @return
     */
    @GetMapping("indexPage")
    public String indexPage(HttpServletRequest request,Model model){
        List<SysRescView> list =  sysRoleRescFeignApi.getRoleRescList("2");
        System.out.print(R.ok(list));
        model.addAttribute("rescList",list);
        return "/index";
    }

    /**
     * 跳转页面
     * @param herf
     * @return
     */
    @GetMapping("/goPage")
    public String goPage(String herf){

        return herf;
    }
}
